﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="KMrpt10.aspx.cs" Inherits="KMrpt10" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>条码打印输出</title>
    <script src="js/extTools.js" type="text/javascript"></script>
    <style>
        .x-grid-row-over .x-grid-cell-inner
        {
            font-weight: bold;
        }
        .x-column-header-inner
        {
            height: 28px;
            background: #E7EBEF url(./images/header.png) repeat-x 0 0;
        }
    </style>
    <script>
        var areachange = function (obj) {
            //alert(obj.value);
            CompanyX.binStock(obj.value);
        }
        var saveData = function () {
            App.Hidden1.setValue(Ext.encode(App.GridPanel1.getRowsValues({ selectedOnly: false, currentPageOnly: true })));
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Neptune" />
        <ext:Hidden ID="Hidden1" runat="server" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
            <Items>
                <ext:Hidden ID="FormatType" runat="server" />
                <ext:GridPanel ID="GridPanel1" runat="server" TitleAlign="Center">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server" Layout="Container">
                            <Items>
                                <ext:Toolbar ID="Toolbar3" runat="server">
                                    <Items>
                                        <ext:DateField runat="server" ID="txtbdate" FieldLabel="开始日期" />
                                        <ext:Label ID="Label1" runat="server" Text="-">
                                        </ext:Label>
                                        <ext:DateField runat="server" ID="txtedate" />
                                        <ext:TextField ID="txtyear" runat="server" FieldLabel="年份" />
                                        <ext:TextField ID="txtseason" runat="server" FieldLabel="季节" />
                                    </Items>
                                </ext:Toolbar>
                                <ext:Toolbar ID="Toolbar4" runat="server">
                                    <Items>
                                        <ext:TextField ID="txtvcode" runat="server" FieldLabel="供应商代码" />
                                        <ext:TextField ID="txtvname" runat="server" FieldLabel="供应商简称" />
                                        <ext:TextField ID="txtstyleno" runat="server" FieldLabel="款号" />
                                        <ext:Button ID="Button1" runat="server" Text="查询" OnDirectClick="BtnQureyUser" UI="Info"
                                            Icon="Find">
                                            <DirectEvents>
                                                <Click Timeout="90000">
                                                    <EventMask ShowMask="true" Msg="加载中...">
                                                    </EventMask>
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                    </Items>
                                </ext:Toolbar>
                                <ext:Toolbar ID="Toolbar2" runat="server">
                                    <Items>
                                        <ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="排序区域:" Reorderable="false" />
                                        <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" Reorderable="false" />
                                    </Items>
                                    <Plugins>
                                        <ext:BoxReorderer ID="BoxReorderer1" runat="server">
                                            <Listeners>
                                                <Drop Handler="changeSortDirection(dragCmp, false);" />
                                            </Listeners>
                                        </ext:BoxReorderer>
                                        <ext:ToolbarDroppable ID="ToolbarDroppable1" runat="server">
                                            <CreateItem Fn="createItem" />
                                            <CanDrop Fn="canDrop" />
                                            <Listeners>
                                                <Drop Fn="doSort" />
                                            </Listeners>
                                        </ext:ToolbarDroppable>
                                    </Plugins>
                                </ext:Toolbar>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="3000" OnReadData="RefreshDataSet"
                            OnSubmitData="Store1_Submit">
                            <Model>
                                <ext:Model ID="Model2" runat="server" IDProperty="ID">
                                    <Fields>
                                        <ext:ModelField Name="单据日期" ServerMapping="billdate" Type="Date" />
                                        <ext:ModelField Name="单据状态" ServerMapping="cnstatename" Type="String" />
                                        <ext:ModelField Name="供应商代码" ServerMapping="vendcustcode" Type="String" />
                                        <ext:ModelField Name="供应商名称" ServerMapping="VendCustName" Type="String" />
                                        <ext:ModelField Name="货品简称" ServerMapping="MATERIALSHORTNAME" Type="String" />
                                        <ext:ModelField Name="款号" ServerMapping="STYLECODE" Type="String" />
                                        <ext:ModelField Name="尺码" ServerMapping="SizeName" Type="String" />
                                        <ext:ModelField Name="颜色名称" ServerMapping="COLORNAME" Type="String" />
                                        <ext:ModelField Name="颜色代码" ServerMapping="colorcode" Type="String" />
                                        <ext:ModelField Name="吊牌价" ServerMapping="RETAILPRICE" Type="String" />
                                        <ext:ModelField Name="型号" ServerMapping="SHOETREENO" Type="String" />
                                        <ext:ModelField Name="条形码" ServerMapping="barcode" Type="String" />
                                        <ext:ModelField Name="面料" ServerMapping="STUFFNAME" Type="String" />
                                        <ext:ModelField Name="面料2" ServerMapping="MASTERITEM" Type="String" />
                                        <ext:ModelField Name="里料" ServerMapping="SUBITEM" Type="String" />
                                        <ext:ModelField Name="填充料" ServerMapping="TEXTURE" Type="String" />
                                        <ext:ModelField Name="充绒量" ServerMapping="bb" Type="String" />
                                        <ext:ModelField Name="执行标准" ServerMapping="SENDCHECKNO" Type="String" />
                                        <ext:ModelField Name="安全技术类别" ServerMapping="SUBSERIES" Type="String" />
                                        <ext:ModelField Name="洗涤标准" ServerMapping="FOREIGNNAME" Type="String" />
                                        <ext:ModelField Name="数量" ServerMapping="Qty" Type="Float" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                    </ColumnModel>
                    <Features>
                        <ext:Summary ID="Summary1" runat="server">
                        </ext:Summary>
                    </Features>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                    </SelectionModel>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label2" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="1000" />
                                        <ext:ListItem Text="3000" />
                                        <ext:ListItem Text="5000" />
                                        <ext:ListItem Text="10000" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="3000" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button2" runat="server" Text="导出Excel(所有)" Icon="PageExcel">
                                    <Listeners>
                                        <Click Handler="exportData('xls');" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="Button3" runat="server" Text="导出(当前页)" AutoPostBack="true" OnClick="ToExcel"
                                    Icon="PageExcel">
                                    <Listeners>
                                        <Click Fn="saveData" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Label runat="server" StyleSpec="color:red;" Text="提示：数据超过3千条以上请使用分批导出功能！">
                                </ext:Label>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                    <Listeners>
                        <AfterLayout Handler="#{ToolbarDroppable1}.addDDGroup(this.child('headercontainer').reorderer.dragZone.ddGroup); doSort();"
                            Single="true" />
                    </Listeners>
                </ext:GridPanel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
